Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: optimize circom proof generation #469

Merged
merged 21 commits into from
Jul 15, 2024

Conversation

chokobole
Copy link
Contributor

Description

This PR optimizes circom proof generation by avoiding parsing zkey and wtns files.

Related: #460

@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch from ccd330e to 7531107 Compare July 14, 2024 15:44
@chokobole chokobole marked this pull request as ready for review July 14, 2024 15:45
@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch from 7531107 to bd59258 Compare July 14, 2024 16:00
@fakedev9999
Copy link

In 134c146, "not moved" -> "not be moved" would be better.

@fakedev9999
Copy link

In 63d388a, there is a typo "pref" -> "perf".

@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch 3 times, most recently from 9ad620b to 84b4bd3 Compare July 15, 2024 03:30
@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch from 84b4bd3 to 46acc2f Compare July 15, 2024 04:08
@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch from 46acc2f to 589c16b Compare July 15, 2024 04:11
@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch from 589c16b to aab44e1 Compare July 15, 2024 04:44
Copy link
Contributor

@batzor batzor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

tachyon/zk/r1cs/groth16/proving_key.h Show resolved Hide resolved
vendors/circom/circomlib/zkey/zkey.h Show resolved Hide resolved
benchmark/msm/README.md Outdated Show resolved Hide resolved
Copy link

@fakedev9999 fakedev9999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This adjustment aims to remove the overhead associated
with parsing zkey.
BREAKING CHANGE: The alignment requirement for `BigInt` is removed.
This alignment was originally inherited from the era-bellman-cuda project
(see: https://github.com/matter-labs/era-bellman-cuda/blob/b52127574e67f4c7938890eab0670ae75f49c22f/src/ff_storage.cuh#L6).
The specific reason for this alignment requirement is unclear,
and its presence necessitates parsing the ZKey.
Since `VerifyingKey` is used in proof generation, it should not be moved.
To ensure that `c[i] = a[i] * b[i]` is executed correctly, `a[i]` and `b[i]`
must be fully computed.
Copy link
Contributor

@dongchangYoo dongchangYoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch from aab44e1 to ac858d5 Compare July 15, 2024 08:46
Copy link
Contributor

@GideokKim GideokKim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

vendors/circom/circomlib/zkey/coefficient.h Outdated Show resolved Hide resolved
vendors/circom/circomlib/zkey/coefficient.h Outdated Show resolved Hide resolved
vendors/circom/circomlib/zkey/coefficient.h Outdated Show resolved Hide resolved
@chokobole chokobole force-pushed the perf/optimize-circom-proof-generation branch from ac858d5 to 6862c02 Compare July 15, 2024 09:01
Copy link
Contributor

@ashjeong ashjeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chokobole chokobole merged commit f9a40b0 into main Jul 15, 2024
3 checks passed
@chokobole chokobole deleted the perf/optimize-circom-proof-generation branch July 15, 2024 09:56
dongchangYoo pushed a commit that referenced this pull request Jul 31, 2024
This is a missing change from PR #469.
dongchangYoo pushed a commit that referenced this pull request Jul 31, 2024
This is a missing change from PR #469.
dongchangYoo pushed a commit that referenced this pull request Jul 31, 2024
This is a missing change from PR #469.
chokobole added a commit that referenced this pull request Jul 31, 2024
This is a missing change from PR #469.
dongchangYoo pushed a commit that referenced this pull request Aug 1, 2024
This is a missing change from PR #469.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants